$j(document).ready(function () {
});


//显示操作按钮
function displayListButtons(status){
}


//刷新列表
function refreshEntityList(){
	searchEntities(false);
}
//分页
function fnOnGoToPage(){
	refreshEntityList();
}

//搜索 isNew标示是否新的搜索,param标示是否自定义参数搜索
function searchEntities(isNew,param){
	var postData;
	var url;
	if(isNew){
		if(null==param){
			if(validateSearchCriteria()){
				//有搜索结果搜索
			    postData = $j('#entitySearchCriteria :input').serializeArray();
			    url=__ctxPath+"/customer/feedbackReply/blank.html?doAction=search&btnSearch=1";
				$j("#entityResults").loading().load(url,postData);
		    }else{
		    	return;
		    }
		}else{
			//新的搜索。全部，上架等
			//有搜索结果搜索
		    postData = $j('#entityResults :input').serializeArray();
		    url=__ctxPath+"/customer/feedbackReply/blank.html?doAction=search&btnSearch=1";
			$j("#entityResults").loading().load(url,postData);  
		}    
	}else{
		postData = $j('#entityResults :input').serializeArray();
		url=__ctxPath+"/customer/feedbackReply/blank.html?&doAction=search";
		$j("#entityResults").loading().load(url,postData);  
	} 
	
}



//验证函数
function validateSearchCriteria(){
	if(!validateForm($j('#entitySearchCriteria').get(0))){
    	return false;
   	}
   	return true;
}

//重设搜索条件
function resetSearchCriteria(){
	$("sc_feedbackUserName").value = "";
	$("sc_status").selectedIndex = 0;
}



//显示/隐藏
function multiToggleShowStatus(){
	var paraData=$j("#entityListForm :input[name='multiIds']").serializeArray();
	if(paraData.length>0){
		$j.post(__ctxPath + "/customer/feedbackReply/blank.html?doAction=multiToggleShowStatus", paraData, multiToggleShowStatusCallback);
	}else{
		alert(__FMT.feedbackList_selectFeedback);
	}
}
//显示/隐藏 callback
function multiToggleShowStatusCallback(){
	sysMsg(__FMT.feedbackList_message_multiToggleShowStatus_success);
	refreshEntityList();
}

//删除
function multiDelete(){
	var paraData=$j("#entityListForm :input[name='multiIds']").serializeArray();
	if(paraData.length>0){
		var itemNames = fnGetSelectedItemNames();
		if(confirm( __FMT.common_message_confirmDeleteThis+"?")){
			$j.post(__ctxPath + "/customer/feedbackReply/blank.html?doAction=multiDelete", paraData, multiDeleteCallback);
		}	
	}else{
		alert(__FMT.feedbackList_selectFeedback);
	}
}
//删除 callback
function multiDeleteCallback(){
	sysMsg(__FMT.feedbackList_message_multiDelete_success);
	refreshEntityList();
}

